package com.wlcorp.forcazamis.business.message.impl;

import java.util.List;

import com.ibatis.dao.client.DaoException;
import com.wlcorp.forcazamis.business.message.IMessageService;
import com.wlcorp.forcazamis.dao.message.IMessageDAO;
import com.wlcorp.forcazamis.dao.message.IMessageStaffDAO;
import com.wlcorp.forcazamis.domain.message.Message;
import com.wlcorp.forcazamis.domain.message.MessageStaff;
import com.wlcorp.forcazamis.domain.system.Staff;
import com.wlcorp.forcazamis.sys.BaseService;

public class MessageServiceImpl extends BaseService implements IMessageService {

	public void deleteMessageStaff(MessageStaff messageStaff)
			throws DaoException {
		messageStaffDAO.deleteMessageStaff(messageStaff);
	}

	public Message getMessageById(Long messageId) throws DaoException {
		return messageDAO.getMessageById(messageId);
	}

	public List<Message> getMessageList(Message message) throws DaoException {
		return messageDAO.getMessageList(message);
	}

	public MessageStaff getMessageStaffById(Long MessageStaffId)
			throws DaoException {
		return messageStaffDAO.getMessageStaffById(MessageStaffId);
	}

	public List<MessageStaff> getMessageStaffList(MessageStaff messageStaff)
			throws DaoException {
		return messageStaffDAO.getMessageStaffList(messageStaff);
	}

	public void saveMessage(Message message) throws DaoException {
		messageDAO.saveMessage(message);
	}

	public void saveMessageStaff(MessageStaff messageStaff) throws DaoException {
		messageStaffDAO.saveMessageStaff(messageStaff);
	}

	private IMessageDAO messageDAO;
	private IMessageStaffDAO messageStaffDAO;

	public IMessageDAO getMessageDAO() {
		return messageDAO;
	}

	public void setMessageDAO(IMessageDAO messageDAO) {
		this.messageDAO = messageDAO;
	}

	public IMessageStaffDAO getMessageStaffDAO() {
		return messageStaffDAO;
	}

	public void setMessageStaffDAO(IMessageStaffDAO messageStaffDAO) {
		this.messageStaffDAO = messageStaffDAO;
	}

	public Integer getUnReadMessageAmount(Staff staff) throws DaoException {
		return messageStaffDAO.getUnReadMessageAmount(staff);
	}

	public Long getMaxMessageId() throws DaoException {
		return messageDAO.getMaxMessageId();
	}

}
